package cn.trigram.lang;

import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class StringUtil {

  public final static String EMPTY = "";

  public final static Pattern WHITE_PATTERN = Pattern.compile("\\s+");

  public static String removeExtraWhitespaces(CharSequence original) {

    return WHITE_PATTERN.splitAsStream(original).collect(Collectors.joining(" "));
  }

}
